#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

bool three_or_more(const string &s1)
{
    return s1.size() < 3;
}

int main(int argc, char *argv[])
{
    vector<string> vs{"hello", "World", "My", "nam", "Is", "yfb"};

    //auto iter = partition(vs.begin(), vs.end(), three_or_more);
    auto iter = partition(vs.begin(), vs.end(),
            [] (const string &s1)
            {
                return s1.size() < 3;
            });

    for (auto it = vs.begin(); it != iter; ++it)
    {
        cout << *it << " ";
    }
    cout << endl;

    for (auto s : vs)
    {
        cout << s << " ";
    }
    cout << endl;
    return 0;
}
